//
// Created by HP on 2024/4/29.
//

#ifndef AURORA_ST_AURORA_MODE_H
#define AURORA_ST_AURORA_MODE_H

#include "common_inc.h"
#include "aurora_label.h"
#define MODE_LEFT_MOTOR 0
#define MODE_RIGHT_MOTOR 1
#define MODE_BOTH_MOTOR 2


#define MODE_HALT_MOTOR 3
#define MODE_OPEN_MOTOR 4
#define MODE_I_MOTOR 5
#define MODE_SPEED_MOTOR 6
#define MODE_POSITION_MOTOR 7
#define MODE_Calibration_MOTOR 8
//电机模式选择
class  Aurora_Mode{

private:

public:
    Aurora_Mode(LCD_Driver *lcd = nullptr,Aurora_Font *font = nullptr,uint8_t sel_m = MODE_BOTH_MOTOR,uint8_t m_sel = MODE_HALT_MOTOR);
    ~Aurora_Mode();

    void add_Driver(LCD_Driver *lcd,Aurora_Font *font);

    void mode_label_init();

    uint8_t get_select_motor(){return select_motor;};
    uint8_t get_mode_sel(){return mode_sel;};

public:
    void switch_sel_motor();
    void switch_prev_mode();
    void switch_next_mode();

    void calibration_motor();
    void send_FOC_mode();
    void send_HALT_motor();
private:
    Aurora_Label title_label;
    Aurora_Label NONE_label;
    Aurora_Label OPEN_LOOP_label;
    Aurora_Label I_LOOP_label;
    Aurora_Label SPEED_LOOP_label;
    Aurora_Label POSITION_LOOP_label;
    Aurora_Label obj_label;    //操作对象


    uint8_t select_motor;
    uint8_t mode_sel;

    LCD_Driver *_lcd;
    Aurora_Font *_font;
};
#endif //AURORA_ST_AURORA_MODE_H
